// #include<stdio.h>
// #include<ctype.h>
// int main()
// {
//    double tocal = 0;
//    int count = 0;
//    char answer = 0;
//    double value = 0;

//    for ( ;;)
//    {
//       printf("Enter a nubmer: ");
//       scanf("%lf",&value);
//       tocal += value;
//       ++count;

//       printf("Do you want to continue?(Y/N)");
//       scanf("%c",&answer);
      
    // while((answer = getchar()=='\n')) 没用
//       if(tolower(answer=='n'))
//         break;
      
//    }
//       printf("The anverage is: %.2lf\n",tocal/count);

//    return 0;
// }
//这里有个问题很烦人！！

//这是一个猜数字的游戏，这个数字在1-20
// #include<stdio.h>
// int main()
// {
//     //初始化guess、chosen、count
//     int guess = 0;
//     int chosen =15;
//     int count = 3;

//     //告诉这是个猜数字游戏，范围是1-20，有三次机会
//      printf("\nThis is a guessing game. ");
//      printf("The number is between 1 and 20.");
    

//      for(;count>0;--count)
//      {
//          printf("\n You have %d tr%s left.",count,count==1?"y":"ies");
//          printf("\n Enter your guess:");

//          scanf("%d",&guess);
//         if(guess==chosen)
//         {
//             printf("\nCongratulations! You guessed it\n");
//             return 0;
//         }
//         else if(guess<1||guess>20)
//         printf("\n I said the number is between 1 and 20\n");
//         else
//         printf("Sorry,%d is worng.My number is %s than that.\n",guess,guess>chosen?"greater":"less");

//      }
//         printf("\nSorry,you have three chances and failed.The number is %d\n",chosen);
//     return 0;
// }

#include<stdio.h>
#include<stdlib.h>
#include<time.h>
int main()
{
    srand(time(NULL));
    int num = rand();
    printf("srand:%d\n",num);
    printf("time:%ld\n",time(NULL));

    return 0;
}